﻿using System;
using System.Collections.Generic;
using Interface;
using Model;

namespace Service
{
    public class UserService : IUserService
    {
        #region 
        private List<User> _UserList = new List<User>()
        {
            new User()
            {
                Id=1,
                Account="Account1",
                Email="123456@qq.com",
                Name="张三",
                Password="123456",
                LoginTime=DateTime.Now,
                Role="Admin"
            },
             new User()
            {
                Id=1,
                Account="Account2",
                Email="654321@qq.com",
                Name="李四",
                Password="654321",
                LoginTime=DateTime.Now,
                Role="user"
            },
              new User()
            {
                Id=1,
                Account="Account3",
                Email="456123@qq.com",
                Name="王五",
                Password="456123",
                LoginTime=DateTime.Now,
                Role="guest"
            },
        };
        #endregion
        public User FindUser(int id)
        {
            return this._UserList.Find(u => u.Id == id);
        }

        public IEnumerable<User> UserAll()
        {
            return this._UserList;
        }
    }
}
